// 函数：加载所有游戏图片
void loadimg() {
    char path[100] = { 0 }; // 用于构建图片路径的缓冲区
    printf("正在加载图片...\n");
    IMAGE img_check; // 临时 IMAGE 对象用于检查加载结果

    // 加载装备图片
    for (int i = 0; i < MAX_EQUIPMENT_IMAGES; i++) {
        sprintf_s(path, sizeof(path), "Assets/Image/Equipment/%d.png", i + 1);
        loadimage(&image_Equipment[i], path); // 尝试加载
        if (image_Equipment[i].getwidth() == 0) { // 检查加载是否成功
             printf("  [失败] 无法加载: %s\n", path);
        }
    }
    // 加载飞机图片
    for (int i = 1; i < MAX_PLANE_IMAGES; i++) { // 跳过索引0，单独加载
        sprintf_s(path, sizeof(path), "Assets/Image/Plane/%d.png", i + 1);
        loadimage(&image_Plane[i], path);
        if (image_Plane[i].getwidth() == 0) {
             printf("  [失败] 无法加载: %s\n", path);
        }
    }
     // 单独加载玩家飞机
     loadimage(&image_Plane[0], "Assets/Image/Plane/plane51.png", 70, 70);
     if (image_Plane[0].getwidth() == 0) {
          printf("  [失败] 无法加载玩家飞机: Assets/Image/Plane/plane51.png\n");
     }

    // 加载子弹图片
    for (int i = 0; i < MAX_BULLET_IMAGES; i++) {
         sprintf_s(path, sizeof(path), "Assets/Image/Bullet/%d.png", i + 1);
         loadimage(&image_Bullet[i], path);
        if (image_Bullet[i].getwidth() == 0) {
             printf("  [失败] 无法加载: %s\n", path);
        }
    }
    // 加载视图/背景图片 (除了特定加载的)
    for (int i = 0; i < MAX_VIEW_IMAGES; i++) {
         if (i == 6 || i == 7) continue; // 跳过单独加载的索引
         sprintf_s(path, sizeof(path), "Assets/Image/View/%d.png", i + 1);
         loadimage(&image_View[i], path);
         if (image_View[i].getwidth() == 0) {
              printf("  [失败] 无法加载: %s\n", path);
         }
    }
     // 单独加载 View[6] 和 View[7] 并检查
     loadimage(&image_View[6], "Assets/Image/View/7.png");
     if (image_View[6].getwidth() == 0) printf("  [失败] 无法加载: Assets/Image/View/7.png\n");
     loadimage(&image_View[7], "Assets/Image/View/8.png", WIDTH, 2880);
     if (image_View[7].getwidth() == 0) printf("  [失败] 无法加载滚动背景: Assets/Image/View/8.png\n");


    // 加载按钮图片
    for (int i = 0; i < MAX_BUTTON_IMAGES; i++) {
        sprintf_s(path, sizeof(path), "Assets/Image/Button/%d.png", i + 1);
         loadimage(&image_Button[i], path);
        if (image_Button[i].getwidth() == 0) {
             printf("  [失败] 无法加载: %s\n", path);
        }
    }
    // 加载敌机图片
    for (int i = 0; i < MAX_ENEMY_IMAGES; i++) {
        sprintf_s(path, sizeof(path), "Assets/Image/Enemy/%d.png", i + 1);
         loadimage(&image_Enemy[i], path);
         if (image_Enemy[i].getwidth() == 0) {
             printf("  [失败] 无法加载: %s\n", path);
        }
    }

    printf("图片加载检查完成。\n");
} 